#include "settingsdialog.h"
#include "ui_settingsdialog.h"

#include <QPaintEvent>
#include <QPainter>
#include "configutil.h"

SettingsDialog::SettingsDialog(QWidget *parent)
    : QDialog(parent)
    , ui(new Ui::SettingsDialog)
{
    ui->setupUi(this);

    auto config = ConfigUtil::getAppSettingsConfig();
    ui->sp_thread_count->setValue(config.value("thread").toInt());
}

SettingsDialog::~SettingsDialog()
{
    auto config = ConfigUtil::getAppSettingsConfig();
    config.insert("thread", ui->sp_thread_count->value());
    ConfigUtil::setAppSettingsConfig(config);
    delete ui;
}
